Skip to content

Support vault provider configs and imported Link wallets - #186

Open
rgarcia wants to merge 5 commits into
mainfrom
hypeship/vault-provider-configs
Open

Support vault provider configs and imported Link wallets#186
rgarcia wants to merge 5 commits into
mainfrom
hypeship/vault-provider-configs

Conversation

@rgarcia

@rgarcia rgarcia commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

SDK dependency

Uses the published @onkernel/sdk 0.101.0 (^0.101.0 in package.json, pinned in bun.lock), released from commit 88e5ccf02ff0b653f8951d38a508a684fe12231b. The stable-SDK merge gate is resolved: the branch now installs, typechecks, and builds using its committed lockfile without a staging dependency or local override.

The released vault resource sources match the previously validated preview ae29b778cecc8aadbf1922c29cd1fcb0464f9ea6. No generated SDK source is committed. Deployment still requires the new API routes and the appropriate vault entitlement; deployed availability was not tested.

Summary

  • Add consolidated manage_vault_provider_configs create/list/get/update/delete actions for organization-owned Link and AgentCard configs, with organization-scoped write checks, single-page pagination, secret rotation without identity changes, no retries, and existing deletion/error conventions.
  • Extend wallet creation with config ID/name selection and backend-supplied Link grants while retaining Kernel-managed defaults. Preserve resolved bindings in public output; distinguish application credentials from user grants and document immutable grants and refresh ownership.
  • Keep secrets out of public projections, validation failures, upstream errors, SDK payload logs, and analytics. Sanitize validation failures at registration while advertising strict schemas. Sanitize complete responses and omit executable hints containing supplied secrets, including collisions in target identifiers.
  • Update card lifecycle guidance for pending edits, omitted versus empty fields, immutable bindings, and recovery_required. Existing user-approval, entitlement gating, project scoping, and no-payment-retry behavior remain intact.

Validation

Rerun against the published 0.101.0 package after bun install --force --frozen-lockfile:

  • bun test: 517 passed, 0 failed across 51 files, using mocked transports; covers tool routing, schemas, scopes, pagination, redaction, Kernel-managed compatibility, and recovery behavior.
  • bunx tsc --noEmit: passed.
  • bun run build: passed with dummy build-time OAuth/Clerk configuration; no real authentication or provider operation.
  • Changed-file Prettier and git diff --check: passed.

Without build-time OAuth configuration, Next.js page-data collection fails on existing required client IDs. The existing next lint script is unsupported on Next.js 16; changed-file Prettier was used instead.

No live provider calls, production mutations, deployment, merge, or release performed by this PR. Review fixes add generic shared 403 guidance and preserve flat multi-action tool handling of unused fields, with regression coverage. Human approval and latest-commit checks are required before merge.

@vercel

vercel Bot commented Sep 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
mcp Ready Ready Preview Sep 11, 2026 2:56pm UTC

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit dad8381. Configure here.

Comment thread src/lib/mcp/vault-responses.ts
Comment thread src/lib/mcp/tools/vault-provider-configs.ts
@socket-security

socket-security Bot commented Sep 11, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​onkernel/​sdk@​0.100.0 ⏵ 0.101.083 +1100100 +199 +1100

View full report

Comment thread src/lib/mcp/vault-responses.ts Outdated

@hiroTamada hiroTamada left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved with two non-blocking suggestions for consolidating secret handling at the validation and response boundaries.

validation: 500 tests passed and bunx tsc --noEmit passed. the edge cases in the inline suggestions were reproduced using the real MCP in-memory transport with mocked upstream responses.

Comment thread src/lib/mcp/vault-schemas.ts Outdated
"Write-only token pair from the same grant. Supply through a trusted backend, never chat. Kernel owns subsequent refresh rotation.",
),
})
.strict("Unexpected imported authorization fields."),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (non-blocking): sanitize validation failures at the vault tool boundary rather than maintaining separate safe/unsafe object schemas. .strict("…") changes the message but still includes raw unknown keys in the Zod error. an otherwise valid imported wallet with an extra authorization["review-secret-sentinel"] property returns that sentinel in the MCP error's keys array, before throwVaultError runs.

using ordinary strict schemas behind a sanitized validation boundary would also remove the secretInputObject workaround, whose .passthrough().refine(...) currently advertises additionalProperties: true in tools/list while rejecting extras at runtime. worth covering misplaced secrets at each nesting level with transport tests.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 6e78833. All five vault tools now wrap each input field at registration with a preprocessing boundary that emits only a fixed validation issue on failure. The ordinary strict schemas still drive tools/list and successful callback parsing; secretInputObject and its passthrough workaround are removed. Real MCP transport regressions cover rejected keys at spec/authorization/client/provider_config/tokens depth, rejected discriminator values, config validation, and additionalProperties: false in discovery. Full suite: 517 passed; typecheck and production build passed. Please re-review this commit before merge.

Comment thread src/lib/mcp/vault-responses.ts Outdated
target: VaultItemTarget,
secrets: (string | undefined)[] = [],
) {
const projected = redactVaultSecrets(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (non-blocking): apply supplied-secret protection to the complete response, not just the projected item. the hints here are constructed afterward from unsanitized target fields. in a mocked wallet import where a synthetic access token was also accidentally supplied as the wallet key, item.key became [redacted] but both observation hints returned the raw token in arguments.key.

keep the upstream field allowlist, then sanitize the complete response at one output boundary. omit unsafe executable hints rather than replacing their identifiers with unusable redacted values. this would also simplify the current project → stringify → parse → construct more output → stringify sequence.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 6e78833. Public projection is followed by complete-response sanitization with one final serialization, without a stringify/parse roundtrip. Observation and invocation hints containing supplied secrets are omitted, never given redacted executable identifiers. The config tool also sanitizes complete acknowledgments, including delete/404 responses. Transport tests reproduce key/vault/project collisions, unsafe operation names, retained safe hints, and config selector collisions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants